/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.pucp.sigepa.recocidosimulado.Modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author carloslengua
 */
@Entity
@Table(name = "itinerario_sim")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ItinerarioSim.findAll", query = "SELECT i FROM ItinerarioSim i"),
    @NamedQuery(name = "ItinerarioSim.findByIditinerario", query = "SELECT i FROM ItinerarioSim i WHERE i.iditinerario = :iditinerario"),
    @NamedQuery(name = "ItinerarioSim.findBySeq", query = "SELECT i FROM ItinerarioSim i WHERE i.seq = :seq")})
public class ItinerarioSim implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "iditinerario")
    private Integer iditinerario;
    @Basic(optional = false)
    @Column(name = "seq")
    private int seq;
    @JoinColumn(name = "idvuelo", referencedColumnName = "idvuelo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private VueloSim vueloSim;
    @JoinColumn(name = "idtipo", referencedColumnName = "idtipo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private TipoEscala tipoEscala;
    @JoinColumn(name = "idestado", referencedColumnName = "idestado")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private EstadoItinerario estadoItinerario;
    @JoinColumn(name = "idenvio", referencedColumnName = "idenvio")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Envio envio;

    public ItinerarioSim() {
    }

    public ItinerarioSim(Integer iditinerario) {
        this.iditinerario = iditinerario;
    }

    public ItinerarioSim(Integer iditinerario, int seq) {
        this.iditinerario = iditinerario;
        this.seq = seq;
    }

    public Integer getIditinerario() {
        return iditinerario;
    }

    public void setIditinerario(Integer iditinerario) {
        this.iditinerario = iditinerario;
    }

    public int getSeq() {
        return seq;
    }

    public void setSeq(int seq) {
        this.seq = seq;
    }

    public VueloSim getVueloSim() {
        return vueloSim;
    }

    public void setVueloSim(VueloSim vueloSim) {
        this.vueloSim = vueloSim;
    }

    public TipoEscala getTipoEscala() {
        return tipoEscala;
    }

    public void setTipoEscala(TipoEscala tipoEscala) {
        this.tipoEscala = tipoEscala;
    }

    public EstadoItinerario getEstadoItinerario() {
        return estadoItinerario;
    }

    public void setEstadoItinerario(EstadoItinerario estadoItinerario) {
        this.estadoItinerario = estadoItinerario;
    }

    public Envio getEnvio() {
        return envio;
    }

    public void setEnvio(Envio envio) {
        this.envio = envio;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iditinerario != null ? iditinerario.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItinerarioSim)) {
            return false;
        }
        ItinerarioSim other = (ItinerarioSim) object;
        if ((this.iditinerario == null && other.iditinerario != null) || (this.iditinerario != null && !this.iditinerario.equals(other.iditinerario))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.pucp.sigepa.recocidosimulado.Modelo.ItinerarioSim[ iditinerario=" + iditinerario + " ]";
    }
    
}
